package io.github.center.common;

import org.springframework.core.annotation.AliasFor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.lang.annotation.*;

/**
 * 包装注解
 *
 * @author haijun
 * @version 1.0.0
 * @email "1424132610@qq.com"
 * @date 2024.10.30 21:17
 * @since 1.0.0
 */
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@RequestMapping
@RestController
public @interface RestRequestWrapper {

    /**
     * Name
     *
     * @return the string
     * @since 1.0.0
     */
    String name() default "";

    /**
     * Rest value
     *
     * @return the string
     * @since 1.0.0
     */
    @AliasFor(
            value = "value",
            annotation = Controller.class
    )
    String restValue() default "";
    /**
     * Value
     *
     * @return the string [ ]
     * @since 1.0.0
     */
    @AliasFor(value = "value", annotation = RequestMapping.class)
    String[] value() default {};

    /**
     * Path
     *
     * @return the string [ ]
     * @since 1.0.0
     */
    @AliasFor(value = "path", annotation = RequestMapping.class)
    String[] path() default {};

    /**
     * Method
     *
     * @return the request method [ ]
     * @since 1.0.0
     */
    @AliasFor(value = "method", annotation = RequestMapping.class)
    RequestMethod[] method() default {};

    /**
     * Params
     *
     * @return the string [ ]
     * @since 1.0.0
     */
    @AliasFor(value = "params", annotation = RequestMapping.class)
    String[] params() default {};

    /**
     * Headers
     *
     * @return the string [ ]
     * @since 1.0.0
     */
    @AliasFor(value = "headers", annotation = RequestMapping.class)
    String[] headers() default {};

    /**
     * Consumes
     *
     * @return the string [ ]
     * @since 1.0.0
     */
    @AliasFor(value = "consumes", annotation = RequestMapping.class)
    String[] consumes() default {};

    /**
     * Produces
     *
     * @return the string [ ]
     * @since 1.0.0
     */
    @AliasFor(value = "produces", annotation = RequestMapping.class)
    String[] produces() default {};

}
